-
-
Notifications
You must be signed in to change notification settings - Fork 155
LONDON | 25-ITP-MAY | TEWODROS BEKERE | SPRINT-3 | Reading-List-App #732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ying books and also improve CSS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you run the test? All tests fails at the moment. Please refactor the code accordingly!
</head> | ||
<body> | ||
<div id="content"> | ||
<ul id="reading-list"></ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hint: You will need to use this id reading-list
to match the test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see the changed files and new commits!
|
||
const bookItem = document.createElement("div"); | ||
bookItem.className = "book"; | ||
bookItem.style.backgroundColor = book.alreadyRead ? "green" : "red"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works fine but it's best to keep styles in the css file rather then modifying in the DOM. I would recommend using class to change the colour. Can you refactor the code accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
bookItem.style.backgroundColor = book.alreadyRead ? "green" : "red"; | ||
|
||
const bookInfo = document.createElement("div"); | ||
bookInfo.innerHTML = `<strong>${book.title}</strong> by <strong>${book.author}</strong>`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
innerHTML has a potential security issue. It's better to avoid using it. FYI, find more in this link. Can you refactor the code with an alternative property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Good job! I've left a few comment. Please let me know if you need any help. |
…ying books and also improve CSS.
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.